Skip to content

Add a CI workflow for the mutablemaps benchmarks - #191

Merged
samuelchassot merged 4 commits into
mainfrom
sam/mutableMapsBenchmark
Nov 25, 2026
Merged

samuelchassot merged 4 commits into
mainfrom
sam/mutableMapsBenchmark

Conversation

@samuelchassot

Copy link
Copy Markdown
Contributor

Add a CI workflow for the mutablemaps benchmarks

Adds a manually dispatched workflow that benchmarks the verified maps against the Scala standard library and produces an HTML report:

  • verified MutableLongMap vs scala.collection.mutable.LongMap
  • verified MutableHashMap vs scala.collection.mutable.HashMap and scala.collection.immutable.HashMap

The full JMH suite takes about 48 hours. This runs a time-boxed selection of it: only the implementations being compared, 6 sizes per benchmark, and shorter iterations (4 × 3 s warmup, 5 × 5 s measurement, 1 fork).

What is added

  • .github/workflows/mutablemaps-benchmarks.yml: runs on workflow_dispatch with a profile input (standard, or smoke to check the pipeline in about 10 minutes). It only installs a JDK 21 and sbt; Stainless and the solvers are not needed to run the benchmarks.
  • run_benchmarks_ci.sh: runs the three benchmark groups and writes one JMH JSON file and one log per group. It downloads the sbt-stainless plugin if it is not installed.
  • benchmark_results/generate_benchmark_report.py: builds a self-contained HTML report (one chart per scenario, verified / standard library ratios, measurement tables) and a Markdown summary. Python standard library only.
  • ImmutableHashMapBenchmark.scala: the three HashMap scenarios for immutable.HashMap, on the same keys as MutableHashMapBenchmarkBig.

What is changed

  • build.sbt: Stainless 0.10.5 with the Scala version it is built for (3.10.1-RC1-bin-20260903-e1f9361-NIGHTLY, LARA fork), set up as in ziplex.
  • All benchmarks now pass their results to a JMH Blackhole instead of an accumulator or a discarded value (VerifiedMapBenchmark.scala, HashMapBenchmark.scala, OtherBenchmark.scala).
  • Main.scala: fixed two references to benchmark.Key and benchmark.HashMapBenchmarkUtilBig, which live in benchmark.maps. The sbt project did not compile without this.
  • README.md: plugin link updated to v0.10.5, and a section on the new script and workflow.

Where the report goes

The workflow uploads the HTML report, the JMH JSON results and the logs as the artifact mutablemaps-benchmarks on the run, and writes the ratio tables to the job summary. Nothing is committed back to the repository.

Duration

The standard profile ran locally in 2h11 before the switch to Blackhole; it has not been re-timed since. The run step is capped at 225 minutes and the job at 240. If the cap is hit, the groups that finished are still reported.

Notes

  • The workflow has not run on GitHub yet; a first dispatch with the smoke profile is the quickest check.
  • The December 2025 result files in benchmark_results/ were measured with the accumulator style and with Scala 3.7.2, so they are not directly comparable with new runs.
  • The runner is a shared machine and each benchmark uses a single fork, so some variation between runs is expected.

Copilot AI balanced review requested due to automatic review settings November 25, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@samuelchassot
samuelchassot merged commit c218d44 into main Nov 25, 2026
1 check passed
@samuelchassot
samuelchassot deleted the sam/mutableMapsBenchmark branch November 25, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants